<ul nz-menu [nzMode]="'horizontal'" class="nav">
    <li nz-menu-item class="" routerLink="/tables/full" [routerLinkActive]="['ant-menu-item-selected']"
        style="outline: none">
        <a style="outline: none">专业管理</a>
    </li>
    <li nz-menu-item routerLink="/tables/standard" [routerLinkActive]="['ant-menu-item-selected']"
        style="outline: none">
        <a style="outline: none">教师管理</a>
    </li>
    <li nz-menu-item routerLink="/tables/student" [routerLinkActive]="['ant-menu-item-selected']" style="outline: none">
        <a style="outline: none">学生管理</a>
    </li>
</ul>

<div class="stuseach" style="padding:15px 0;position:relative;overflow: hidden">
    <button nz-button [nzType]="'primary'" style="float: left" (click)="resetPwd()"><i class="anticon anticon-unlock"></i>重置密码</button>

    <nz-input [nzPlaceHolder]="'请输入您要搜索的学生姓名'" [(ngModel)]="_value"
              style="width: 300px;float: right;margin-right: 3px;"></nz-input>
    <button style="position: absolute;right: 5px;top: 17px;background: #fff;border: 0;outline: none;width: 24px;height: 24px;cursor: pointer;" (click)="doSearch()"><i class="anticon anticon-search"></i></button>
</div>

<nz-table #nzTable [nzDataSource]="data" [nzPageSize]="10" (nzDataChange)="_displayDataChange($event)"
          (nzPageIndexChange)="_refreshStatus()" (nzPageSizeChange)="_refreshStatus()" [nzTotal]="total">
    <thead nz-thead>
    <tr>
        <th nz-th nzCheckbox>
            <label nz-checkbox [(ngModel)]="_allChecked" [nzIndeterminate]="_indeterminate"
                   (ngModelChange)="_checkAll($event)">
            </label>
        </th>
        <th nz-th>
            <span>学生名称</span>
            <nz-table-sort [(nzValue)]="sortMap.stu_name" (nzValueChange)="sort('stu_name',$event)"></nz-table-sort>
        </th>
        <th nz-th>
            <span>专业名称</span>
            <nz-table-sort [(nzValue)]="sortMap.major_name" (nzValueChange)="sort('major_name',$event)"></nz-table-sort>
        </th>
        <th nz-th>
            <span>班级名称</span>
            <nz-table-sort [(nzValue)]="sortMap.cla_name" (nzValueChange)="sort('cla_name',$event)"></nz-table-sort>
        </th>
        <th nz-th>
            <span>关联教师</span>
        </th>
        <th nz-th>
            操作
        </th>
    </tr>
    </thead>
    <tbody nz-tbody>
    <tr nz-tbody-tr *ngFor="let data of nzTable.data">
        <td nz-td nzCheckbox>
            <label nz-checkbox [(ngModel)]="data.checked" (ngModelChange)="_refreshStatus($event)">
            </label>
        </td>
        <td nz-td>{{data.stu_name}}</td>
        <td nz-td>{{data.major_name}}</td>
        <td nz-td>{{data.cla_name}}</td>
        <td nz-td><a (click)="tecShow(data)">{{data.teacherTotal}}</a></td>
        <td>
            <a (click)="isDelstu(data)">删除</a>
        </td>
    </tr>
    </tbody>
</nz-table>

<nz-modal [nzWrapClassName]="'vertical-center-modal'" [nzFooter]="''" [nzVisible]="isModaltec" [nzTitle]="'关联教师'"
          [nzContent]="teacherContent" (nzOnCancel)="isModaltec=false" (nzOnOk)="isModaltec=false"
          [nzStyle]="style" [nzOkText]="'确定'" [nzCancelText]="'取消'">
    <ng-template #teacherContent>
        <table cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td width="20%" align="right" height="50px">学生姓名：</td>
                <td>
                    {{ studentName }}
                </td>
            </tr>
            <tr>
                <td align="right" style="min-height: 50px">教师列表：</td>
                <td>
                    <ul style="border: 1px solid #ddd;max-height: 120px;overflow-y: auto;padding:10px;padding-bottom:0;width: 500px">
                        <li style="float:left;margin:0 20px 10px 10px" *ngFor="let list of tecList">
                            {{list.UserName}}
                        </li>
                    </ul>
                </td>
            </tr>
        </table>
    </ng-template>
</nz-modal>
<nz-modal [nzWrapClassName]="'vertical-center-modal'" [nzFooter]="'true'" [nzVisible]="isRemove" [nzTitle]="'提示'"
          [nzContent]="removeContent" (nzOnCancel)="isRemove=false" (nzOnOk)="deleteStu()"
          [nzStyle]="style" [nzOkText]="'确定'" [nzCancelText]="'取消'">
    <ng-template #removeContent>
        <p>是否删除 <b>{{ removeStuName }}</b> 同学？</p>
    </ng-template>
</nz-modal>
